<?php
	$dir = dirname(__FILE__); //找到当前脚本所在路径

	require($dir . '/PHPExcel/PHPExcel.php');
	$objPHPExcel = new PHPExcel();
	$objSheet = $objPHPExcel->getActiveSheet();
	$objSheet->setTitle('demo');
	$objSheet->setCellValue('A1','name')->setCellValue("B1",'grade');
	$objSheet->setCellValue("A2",'xiaojing')->setCellValue("B2",'50');
	$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel,'Excel2007');
	$objWriter->save($dir.'/demo'.time().'.xlsx');